package com.cgc.venus.server.app.inter;

import com.cgc.venus.server.app.bean.ImageParaBean;
import com.cgc.venus.server.app.bean.ImageVersionDetailBean;
import com.cgc.venus.server.app.bean.RepoBean;
import com.cgc.venus.server.app.bean.RepoDetialBean;
import com.cgc.venus.server.core.exception.VenusException;
import com.cgc.venus.server.core.harbor.model.Tag;
import org.elasticsearch.common.recycler.Recycler;

import java.util.List;

/**
 * Created by xiaobin on 2017/9/25.
 */
public interface AppRepositoryService {
    //    根据关键字和项目名称查询私有空间下的镜像
    public List<RepoBean> repoPrivateQuery(String queryKey, String spaceName) throws VenusException;

    //   根据关键字和项目名称查询公有有空间下的镜像
    public List<RepoBean> repoPublicQuery(String queryKey, String spaceName) throws VenusException;

    //    根据镜像查询的镜像的明细
    public List<RepoDetialBean> imageQuery(String repoName) throws VenusException;

    //    根据镜像名称查询是该镜像是否在私有空间表存在
    public boolean repoNameExist(String repoName) throws VenusException;

    //    根据镜像名称删除镜像
    public boolean repoDelete(String nameRepo, String tags) throws VenusException;

    //    设置镜像为私有
    public boolean repoSetPrivate(String nameRepo) throws VenusException;

    //    设置镜像为公有
    public boolean repoSetPublic(String nameRepo) throws VenusException;

    //镜像版本信息查询
    public List<Tag> appTagsQuery(String name) throws VenusException;//应用版本信息查询


    /*
    * 获得镜像版本明细说明
    * */
    ImageVersionDetailBean getImageVersionDescribed(String image, String version) throws VenusException;

    /*
    * 新增镜像版本,明细说明
    * */
    int addImageVersionDescribed(ImageVersionDetailBean imageVersionDetailBean) throws VenusException;

    /*
    * 修改镜像版本,明细说明
    * */
    int editImageVersionDescribed(ImageVersionDetailBean imageVersionDetailBean) throws VenusException;

    /*
    * 获得所有镜像版本的明细说明
    * */
    List<ImageVersionDetailBean> getImageDescribed(String image) throws VenusException;

    /*
    * 删除镜像版本明细
    * */
    int deleteImageVersionDescribed(String image) throws VenusException;

    int deleteImageVersionDescribed(String image,String version) throws VenusException;

    /**
     * 获取空间参数信息
     * @param namespace
     * @return
     * @throws VenusException
     */
    public List<ImageParaBean> getImageParaByNamespace(String namespace) throws VenusException;

    public String setImagePara(List<ImageParaBean> imageParaBeans,String namespace) throws VenusException;
}
